Crate filecoin_proofs[][src]

Re-exports

pub use constants::*;
pub use types::*;

Modules

Macros

Calls a function with the type hint of the sector shape matching the provided sector. Panics if provided with an unknown sector size.

Structs

Calculates comm-d of the data piped through to it. Data must be bit padded and power of 2 bytes.

Functions

Computes a NUL-byte prefix and/or suffix for source using the provided piece_lengths and piece_size (such that the source, after preprocessing, will occupy a subtree of a merkle tree built using the bytes from target), runs the resultant byte stream through the preprocessor, and writes the result to target. Returns a tuple containing the number of bytes written to target (source plus alignment) and the commitment.

Given a porep_config and a list of seal commit outputs, this method aggregates those proofs (naively padding the count if necessary up to a power of 2) and returns the aggregate proof bytes.

Computes a sectors’s comm_d given its pieces.

Generates the challenges per SectorId required for either a Window proof-of-spacetime or a Winning proof-of-spacetime.

Generates a piece commitment for the provided byte source. Returns an error if the byte source produced more than piece_size bytes.

Generates a single vanilla proof required for either Window proof-of-spacetime or Winning proof-of-spacetime.

Generates a Window proof-of-spacetime with provided vanilla proofs of a single partition.

Generates a Window proof-of-spacetime.

Generates a Window proof-of-spacetime with provided vanilla proofs.

Generates a Winning proof-of-spacetime.

Given some randomness and the length of available sectors, generates the challenged sector.

Generates a Winning proof-of-spacetime with provided vanilla proofs.

Given the specified arguments, this method returns the inputs that were used to generate the seal proof. This can be useful for proof aggregation, as verification requires these inputs.

Unseals the sector at sealed_path and returns the bytes for a piece whose first (unpadded) byte begins at offset and ends at offset plus num_bytes, inclusive. Note that the entire sector is unsealed each time this function is called.

Unseals the sector read from sealed_sector and returns the bytes for a piece whose first (unpadded) byte begins at offset and ends at offset plus num_bytes, inclusive. Note that the entire sector is unsealed each time this function is called.

Unseals the sector read from sealed_sector and returns the bytes for a piece whose first (unpadded) byte begins at offset and ends at offset plus num_bytes, inclusive. Note that the entire sector is unsealed each time this function is called.

Given a porep_config, an aggregate proof, a list of seeds and a combined and flattened list of public inputs, this method verifies the aggregate seal proof.

Verifies a batch of outputs of some previously-run seal operations.

Verifies the output of some previously-run seal operation.

Verifies a window proof-of-spacetime.

Verifies a winning proof-of-spacetime.

Writes bytes from source to target, adding bit-padding (“preprocessing”) as needed. Returns a tuple containing the number of bytes written to target and the commitment.